<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改特殊渠道信息')" />
    <th:block th:include="include :: datetimepicker-css" />
    <th:block th:include="include :: jsonview-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-info-edit" th:object="${specialCostomInfo}">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label">名称：</label>
                <div class="col-sm-8">
                    <input name="name" th:field="*{name}" class="form-control" readonly type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">描述信息：</label>
                <div class="col-sm-8">
                    <input name="descInfo" th:field="*{descInfo}"  class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">客户经理：</label>
                <div class="col-sm-8">
                    <select class="form-control" th:field="*{ownerUserId}"   name="ownerUserId">
                        <option th:each="item:${managerInfoList}" th:value="${item.userId}" th:text="${item.username}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">账户余额：</label>
                <div class="col-sm-8">
                    <input name="remainAmount" th:field="*{remainAmount}" class="form-control" type="text">
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label">机构类型：</label>
                <div class="col-sm-8">
                    <input name="infoType" th:field="*{infoType}" class="form-control" readonly type="text" id="infoType">
                </div>
            </div>


        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <th:block th:include="include :: jsonview-js" />
    <script th:inline="javascript">
        var prefix = ctx + "special/info";
        $("#form-info-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-info-edit').serialize());
            }
        }

        $(document).ready(function () {

            var type = $("#infoType").val()
            console.log(type);
            if (type == 'API'){
                $("#apiShow").show();
            }else if(type == 'CRM') {
                $("#apiShow").hide();
            }

        });

    </script>
</body>
</html>